<!--
* @Author: white_queen
* @Date: 2024-07-19 17:50:12
* @LastEditors: white_queen
* @LastEditTime: 2024-07-19 17:50:31
* @FilePath: /pages/scoreShop/pay/pay.vue
* @Description: 积分商品 确认订单 => 提交订单 页面 
-->

<template>
	<view class="page">
		<view class="address">
			<image class="address-icon" src="../../../static/icon/address.png" mode="widthFix"></image>
			<view class="address-center">
				<view class="address-center-main">重庆重庆市江北区红旗河沟街道世纪英皇南塔23-2</view>
				<view class="address-center-bottom">李爆爆 13121345567</view>
			</view>
			<image class="address-right" src="../../../static/icon/right.png" mode="widthFix"></image>
		</view>
		<view class="product">
			<view class="item" v-for="item in info.goods_info" :key="item.id">
				<image class="item-image" :src="item.image" mode="aspectFill"></image>
				<view class="item-right">
					<view class="item-right-top">{{ item.name }}</view>
					<view class="item-right-bottom">
						<view class="num">x{{ item.buy_num }}</view>
						<view class="money">￥{{ item.price }}</view>
					</view>
				</view>
			</view>

			<view class="all-money">
				<view class="title">商品总额</view>
				<view class="money">￥{{ info.price_all }}</view>
			</view>
		</view>
		<view class="pay">
			<view class="left">
				<image class="pay-icon" src="../../../static/icon/路径.png" mode="widthFix"></image>
				<view class="text">微信支付</view>
			</view>
			<image class="right-icon" src="../../../static/icon/单选选中.png" mode="widthFix"></image>
		</view>
		<view class="bottom">
			<view class="bottom-left">
				<view class="title">待支付</view>
				<view class="bottom-left-money">¥{{ info.price_all }}</view>
			</view>
			<view @click="submitPay" class="pay-btn">立即支付</view>
		</view>
	</view>
</template>

<script>
import httpApi from '../../../http';
export default {
	data() {
		return {
			params: {},
			info: {
				goods_info: []
			}
		};
	},
	onLoad(e) {
		this.params = JSON.parse(e.params);
		this.init();
	},
	methods: {
		init() {
			httpApi.OrderApi.confirmOrder(this.params).then((res) => {
				console.log(res);
				this.info = res.data;
			});
		},
		submitPay() {
			httpApi.OrderApi.submitOrder(this.params).then((res) => {
				console.log(res);
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.page {
	padding-top: 40rpx;
	padding-bottom: 150rpx;
}
.address {
	width: 690rpx;
	padding: 38rpx 30rpx;
	margin: 0 auto 0;
	box-sizing: border-box;
	background-color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	border-radius: 20rpx;
	.address-icon,
	.address-right {
		width: 48rpx;
	}
	.address-center {
		width: 524rpx;
		display: flex;
		flex-direction: column;
		.address-center-main {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 600;
			font-size: 28rpx;
			color: #000000;
			line-height: 40rpx;
		}
		.address-center-bottom {
			margin-top: 20rpx;
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
			line-height: 40rpx;
		}
	}
}
.product {
	width: 690rpx;
	padding: 38rpx 30rpx;
	margin: 20rpx auto 0;
	border-radius: 20rpx;
	box-sizing: border-box;
	background-color: #fff;
	display: flex;
	flex-direction: column;
	.item {
		width: 100%;
		height: 160rpx;
		display: flex;
		align-items: center;
		margin-bottom: 30rpx;
		.item-image {
			width: 160rpx;
			height: 160rpx;
			border-radius: 16rpx;
		}
		.item-right {
			height: 160rpx;
			margin-left: 30rpx;
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			.item-right-top {
				font-family: SourceHanSerifCN, SourceHanSerifCN;
				font-weight: 500;
				font-size: 32rpx;
				color: #303133;
				line-height: 46rpx;
			}
			.item-right-bottom {
				display: flex;
				justify-content: space-between;
				align-items: flex-end;
				.num {
					font-family: SourceHanSerifCN, SourceHanSerifCN;
					font-weight: 400;
					font-size: 24rpx;
					color: #333333;
					line-height: 34rpx;
				}
				.money {
					font-family: SourceHanSerifCN, SourceHanSerifCN;
					font-weight: 500;
					font-size: 32rpx;
					color: #ee1616;
					line-height: 46rpx;
				}
			}
		}
	}
	.all-money {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 30rpx;
		.title {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
			line-height: 40rpx;
		}
		.money {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #999;
			line-height: 40rpx;
		}
		.pay-money {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #2e2e2e;
			line-height: 40rpx;
		}
	}
}
.pay {
	width: 690rpx;
	padding: 38rpx 30rpx;
	margin: 20rpx auto 0;
	border-radius: 20rpx;
	box-sizing: border-box;
	background-color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
	.left {
		display: flex;
		align-items: center;
		.pay-icon {
			width: 48rpx;
		}
		.text {
			margin-left: 20rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #2e2e2e;
			line-height: 40rpx;
		}
	}
	.right-icon {
		width: 48rpx;
	}
}
.bottom {
	width: 750rpx;
	height: 150rpx;
	padding: 0 30rpx;
	box-sizing: border-box;
	background: #ffffff;
	position: fixed;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	.bottom-left {
		display: flex;
		align-items: center;
		.title {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
			line-height: 30rpx;
		}
		.bottom-left-money {
			font-family: SourceHanSerifCN, SourceHanSerifCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #ee1616;
			line-height: 30rpx;
			margin-left: 20rpx;
		}
	}
	.pay-btn {
		width: 284rpx;
		height: 90rpx;
		background: $uni-theme-color;
		border-radius: 10rpx;
		font-family: SourceHanSerifCN, SourceHanSerifCN;
		font-weight: 500;
		font-size: 32rpx;
		color: #ffffff;
		line-height: 32rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}
</style>
